home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 02 - 1986 / 02.03 Mar 86.sit / 02.03 Mar 86 / Modula2 2-3 / resource mover / MoveResources.MOD < prev    next >
MacBinary  |  1986-01-11  |  9.8 KB  |  [TEXT/EDIT]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert SoundTracker Module (music/soundTracker) ext Supported
66% dexvert Chip Tracker Module (music/chipTracker) ext Supported
66% dexvert Protracker Module (music/mod) ext Supported
66% dexvert Octalyser Module (music/octalyser) ext Supported
66% dexvert Star Tracker/StarTrekker Module (music/starTracker) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert PollyTracker Module (music/pollyTracker) ext Unsupported
1% dexvert Black Viper packed music (music/blackViperPackedMusic) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat Jan 11 13:52:42 1986, modified Sat Jan 11 13:52:42 1986, creator Macintosh Edit, type ASCII, 9275 bytes "MoveResources.MOD" , at 0x24bb 490 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[EDIT]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 11 4d 6f 76 65 52 65 | 73 6f 75 72 63 65 73 2e |..MoveRe|sources.|
|00000010| 4d 4f 44 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |MOD.....|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 45 44 49 | 54 01 00 00 00 00 00 00 |.TEXTEDI|T.......|
|00000050| 00 00 00 00 00 24 3b 00 | 00 01 ea 9a 4c 66 fa 9a |.....$;.|....Lf..|
|00000060| 4c 66 fa 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |Lf......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 14 1f 00 00 |........|........|
|00000080| 28 2a 20 54 6f 6d 20 54 | 61 79 6c 6f 72 0d 09 20 |(* Tom T|aylor.. |
|00000090| 33 37 30 37 20 50 6f 69 | 6e 63 69 61 6e 61 20 44 |3707 Poi|nciana D|
|000000a0| 72 2e 20 23 31 33 37 0d | 09 20 53 61 6e 74 61 20 |r. #137.|. Santa |
|000000b0| 43 6c 61 72 61 2c 20 43 | 41 20 39 35 30 35 31 0d |Clara, C|A 95051.|
|000000c0| 2a 29 0d 49 4d 50 4c 45 | 4d 45 4e 54 41 54 49 4f |*).IMPLE|MENTATIO|
|000000d0| 4e 20 4d 4f 44 55 4c 45 | 20 4d 6f 76 65 52 65 73 |N MODULE| MoveRes|
|000000e0| 6f 75 72 63 65 73 3b 0d | 0d 09 28 2a 20 54 68 69 |ources;.|..(* Thi|
|000000f0| 73 20 6d 6f 64 75 6c 65 | 20 63 6f 6e 74 61 69 6e |s module| contain|
|00000100| 73 20 74 68 65 20 63 6f | 64 65 20 66 6f 72 0d 09 |s the co|de for..|
|00000110| 20 20 20 63 6f 70 79 69 | 6e 67 20 72 65 73 6f 75 | copyi|ng resou|
|00000120| 72 63 65 73 20 66 72 6f | 6d 20 6f 6e 65 20 66 69 |rces fro|m one fi|
|00000130| 6c 65 0d 09 09 20 74 6f | 20 61 6e 6f 74 68 65 72 |le... to| another|
|00000140| 2e 20 2a 29 0d 0d 09 49 | 4d 50 4f 52 54 20 53 74 |. *)...I|MPORT St|
|00000150| 6f 72 61 67 65 3b 0d 09 | 0d 09 46 52 4f 4d 20 49 |orage;..|..FROM I|
|00000160| 6e 4f 75 74 20 49 4d 50 | 4f 52 54 0d 09 20 20 57 |nOut IMP|ORT.. W|
|00000170| 72 69 74 65 2c 20 57 72 | 69 74 65 53 74 72 69 6e |rite, Wr|iteStrin|
|00000180| 67 2c 0d 09 09 57 72 69 | 74 65 49 6e 74 2c 20 57 |g,...Wri|teInt, W|
|00000190| 72 69 74 65 4c 6e 3b 0d | 0d 09 46 52 4f 4d 20 4d |riteLn;.|..FROM M|
|000001a0| 61 63 53 79 73 74 65 6d | 54 79 70 65 73 20 49 4d |acSystem|Types IM|
|000001b0| 50 4f 52 54 0d 09 09 48 | 61 6e 64 6c 65 2c 20 53 |PORT...H|andle, S|
|000001c0| 74 72 32 35 35 2c 20 4c | 6f 6e 67 43 61 72 64 3b |tr255, L|ongCard;|
|000001d0| 0d 09 09 0d 20 20 46 52 | 4f 4d 20 52 65 73 6f 75 |.... FR|OM Resou|
|000001e0| 72 63 65 4d 61 6e 61 67 | 65 72 20 49 4d 50 4f 52 |rceManag|er IMPOR|
|000001f0| 54 0d 20 20 20 20 43 6c | 6f 73 65 52 65 73 46 69 |T. Cl|oseResFi|
|00000200| 6c 65 2c 20 52 65 73 45 | 72 72 6f 72 2c 0d 20 20 |le, ResE|rror,. |
|00000210| 20 20 43 6f 75 6e 74 54 | 79 70 65 73 2c 20 52 65 | CountT|ypes, Re|
|00000220| 73 54 79 70 65 2c 0d 20 | 20 20 20 4f 70 65 6e 52 |sType,. | OpenR|
|00000230| 65 73 46 69 6c 65 2c 20 | 47 65 74 49 6e 64 54 79 |esFile, |GetIndTy|
|00000240| 70 65 2c 20 0d 20 20 20 | 20 43 6f 75 6e 74 52 65 |pe, . | CountRe|
|00000250| 73 6f 75 72 63 65 73 2c | 20 48 6f 6d 65 52 65 73 |sources,| HomeRes|
|00000260| 46 69 6c 65 2c 0d 20 20 | 20 20 47 65 74 49 6e 64 |File,. | GetInd|
|00000270| 52 65 73 6f 75 72 63 65 | 2c 20 52 65 6c 65 61 73 |Resource|, Releas|
|00000280| 65 52 65 73 6f 75 72 63 | 65 2c 0d 20 20 20 20 53 |eResourc|e,. S|
|00000290| 65 74 52 65 73 4c 6f 61 | 64 2c 20 43 72 65 61 74 |etResLoa|d, Creat|
|000002a0| 65 52 65 73 46 69 6c 65 | 2c 0d 20 20 20 20 4c 6f |eResFile|,. Lo|
|000002b0| 61 64 52 65 73 6f 75 72 | 63 65 2c 20 55 73 65 52 |adResour|ce, UseR|
|000002c0| 65 73 46 69 6c 65 2c 0d | 20 20 20 20 47 65 74 52 |esFile,.| GetR|
|000002d0| 65 73 49 6e 66 6f 2c 20 | 41 64 64 52 65 73 6f 75 |esInfo, |AddResou|
|000002e0| 72 63 65 2c 0d 20 20 20 | 20 44 65 74 61 63 68 52 |rce,. | DetachR|
|000002f0| 65 73 6f 75 72 63 65 2c | 20 47 65 74 52 65 73 6f |esource,| GetReso|
|00000300| 75 72 63 65 2c 0d 09 09 | 52 6d 76 65 52 65 73 6f |urce,...|RmveReso|
|00000310| 75 72 63 65 3b 0d 0d 20 | 20 46 52 4f 4d 20 46 69 |urce;.. | FROM Fi|
|00000320| 6c 65 4d 61 6e 61 67 65 | 72 20 49 4d 50 4f 52 54 |leManage|r IMPORT|
|00000330| 0d 09 09 46 53 4f 70 65 | 6e 52 46 2c 20 47 65 74 |...FSOpe|nRF, Get|
|00000340| 56 6f 6c 2c 0d 09 09 46 | 53 43 6c 6f 73 65 2c 20 |Vol,...F|SClose, |
|00000350| 46 53 57 72 69 74 65 2c | 0d 09 09 53 65 74 45 4f |FSWrite,|...SetEO|
|00000360| 46 3b 0d 09 0d 09 46 52 | 4f 4d 20 53 74 72 69 6e |F;....FR|OM Strin|
|00000370| 67 73 20 49 4d 50 4f 52 | 54 0d 09 20 20 53 74 72 |gs IMPOR|T.. Str|
|00000380| 4d 6f 64 54 6f 4d 61 63 | 3b 0d 0d 09 46 52 4f 4d |ModToMac|;...FROM|
|00000390| 20 53 59 53 54 45 4d 20 | 49 4d 50 4f 52 54 0d 09 | SYSTEM |IMPORT..|
|000003a0| 09 41 44 52 3b 0d 0d 09 | 43 4f 4e 53 54 0d 09 09 |.ADR;...|CONST...|
|000003b0| 52 65 73 4e 6f 74 46 6f | 75 6e 64 20 20 20 20 20 |ResNotFo|und |
|000003c0| 3d 20 2d 31 39 32 3b 0d | 09 09 4e 6f 45 72 72 20 |= -192;.|..NoErr |
|000003d0| 20 20 20 20 20 20 20 20 | 20 20 3d 20 20 20 20 30 | | = 0|
|000003e0| 3b 0d 09 09 46 69 6c 65 | 4e 6f 74 46 6f 75 6e 64 |;...File|NotFound|
|000003f0| 45 72 72 20 3d 20 20 2d | 34 33 3b 0d 09 09 0d 09 |Err = -|43;.....|
|00000400| 4d 4f 44 55 4c 45 20 4c | 69 6e 6b 65 64 4c 69 73 |MODULE L|inkedLis|
|00000410| 74 3b 0d 09 0d 09 09 28 | 2a 20 54 68 69 73 20 69 |t;.....(|* This i|
|00000420| 6e 74 65 72 6e 61 6c 20 | 6d 6f 64 75 6c 65 20 69 |nternal |module i|
|00000430| 73 20 75 73 65 64 0d 09 | 09 20 20 20 66 6f 72 20 |s used..|. for |
|00000440| 6d 61 69 6e 74 61 69 6e | 69 6e 67 20 61 20 6c 69 |maintain|ing a li|
|00000450| 6e 6b 65 64 20 6c 69 73 | 74 0d 09 09 09 20 6f 66 |nked lis|t.... of|
|00000460| 20 72 65 73 6f 75 72 63 | 65 20 68 61 6e 64 6c 65 | resourc|e handle|
|00000470| 73 2e 20 2a 29 0d 09 0d | 09 09 49 4d 50 4f 52 54 |s. *)...|..IMPORT|
|00000480| 20 48 61 6e 64 6c 65 3b | 0d 09 09 0d 09 09 46 52 | Handle;|......FR|
|00000490| 4f 4d 20 53 74 6f 72 61 | 67 65 20 49 4d 50 4f 52 |OM Stora|ge IMPOR|
|000004a0| 54 0d 09 09 09 41 4c 4c | 4f 43 41 54 45 2c 20 44 |T....ALL|OCATE, D|
|000004b0| 45 41 4c 4c 4f 43 41 54 | 45 3b 0d 09 09 0d 09 09 |EALLOCAT|E;......|
|000004c0| 45 58 50 4f 52 54 0d 09 | 09 09 41 64 64 52 73 72 |EXPORT..|..AddRsr|
|000004d0| 63 4e 6f 64 65 2c 0d 09 | 09 09 52 6d 76 65 52 73 |cNode,..|..RmveRs|
|000004e0| 72 63 4e 6f 64 65 3b 0d | 09 09 09 0d 09 09 54 59 |rcNode;.|......TY|
|000004f0| 50 45 0d 09 09 09 52 73 | 72 63 50 74 72 20 3d 20 |PE....Rs|rcPtr = |
|00000500| 50 4f 49 4e 54 45 52 20 | 54 4f 20 52 73 72 63 4e |POINTER |TO RsrcN|
|00000510| 6f 64 65 3b 0d 09 09 09 | 0d 09 09 09 52 73 72 63 |ode;....|....Rsrc|
|00000520| 4e 6f 64 65 20 3d 20 52 | 45 43 4f 52 44 0d 09 09 |Node = R|ECORD...|
|00000530| 09 09 09 09 09 09 09 20 | 72 73 72 63 48 61 6e 64 |....... |rsrcHand|
|00000540| 6c 65 20 3a 20 48 61 6e | 64 6c 65 3b 0d 09 09 09 |le : Han|dle;....|
|00000550| 09 09 09 09 09 09 20 6e | 65 78 74 20 3a 20 52 73 |...... n|ext : Rs|
|00000560| 72 63 50 74 72 3b 0d 09 | 09 09 09 09 09 09 09 20 |rcPtr;..|....... |
|00000570| 45 4e 44 3b 0d 09 0d 09 | 09 56 41 52 0d 09 09 09 |END;....|.VAR....|
|00000580| 72 73 72 63 48 65 61 64 | 20 3a 20 52 73 72 63 50 |rsrcHead| : RsrcP|
|00000590| 74 72 3b 20 28 2a 20 50 | 6f 69 6e 74 65 72 20 74 |tr; (* P|ointer t|
|000005a0| 6f 20 74 68 65 0d 09 09 | 09 09 09 09 09 09 09 09 |o the...|........|
|000005b0| 09 09 09 09 20 66 69 72 | 73 74 20 6e 6f 64 65 2e |.... fir|st node.|
|000005c0| 20 2a 29 0d 09 0d 09 09 | 50 52 4f 43 45 44 55 52 | *).....|PROCEDUR|
|000005d0| 45 20 41 64 64 52 73 72 | 63 4e 6f 64 65 28 64 61 |E AddRsr|cNode(da|
|000005e0| 74 61 20 3a 20 48 61 6e | 64 6c 65 29 3b 0d 09 09 |ta : Han|dle);...|
|000005f0| 28 2a 20 54 68 69 73 20 | 70 72 6f 63 65 64 75 72 |(* This |procedur|
|00000600| 65 20 61 64 64 73 20 61 | 20 6e 65 77 20 6e 6f 64 |e adds a| new nod|
|00000610| 65 0d 09 09 20 20 20 74 | 6f 20 74 68 65 20 66 72 |e... t|o the fr|
|00000620| 6f 6e 74 20 6f 66 20 74 | 68 65 20 6c 69 6e 6b 65 |ont of t|he linke|
|00000630| 64 20 6c 69 73 74 2e 20 | 2a 29 0d 09 09 09 56 41 |d list. |*)....VA|
|00000640| 52 0d 09 09 09 09 6e 65 | 77 4e 6f 64 65 20 3a 20 |R.....ne|wNode : |
|00000650| 52 73 72 63 50 74 72 3b | 0d 09 09 42 45 47 49 4e |RsrcPtr;|...BEGIN|
|00000660| 0d 09 09 09 4e 45 57 28 | 6e 65 77 4e 6f 64 65 29 |....NEW(|newNode)|
|00000670| 3b 0d 09 09 09 57 49 54 | 48 20 6e 65 77 4e 6f 64 |;....WIT|H newNod|
|00000680| 65 5e 20 44 4f 0d 09 09 | 09 09 72 73 72 63 48 61 |e^ DO...|..rsrcHa|
|00000690| 6e 64 6c 65 20 3a 3d 20 | 64 61 74 61 3b 0d 09 09 |ndle := |data;...|
|000006a0| 09 09 6e 65 78 74 20 3a | 3d 20 72 73 72 63 48 65 |..next :|= rsrcHe|
|000006b0| 61 64 3b 0d 09 09 09 45 | 4e 44 3b 0d 09 09 09 72 |ad;....E|ND;....r|
|000006c0| 73 72 63 48 65 61 64 20 | 3a 3d 20 6e 65 77 4e 6f |srcHead |:= newNo|
|000006d0| 64 65 3b 0d 09 09 45 4e | 44 20 41 64 64 52 73 72 |de;...EN|D AddRsr|
|000006e0| 63 4e 6f 64 65 3b 0d 09 | 09 0d 09 09 50 52 4f 43 |cNode;..|....PROC|
|000006f0| 45 44 55 52 45 20 52 6d | 76 65 52 73 72 63 4e 6f |EDURE Rm|veRsrcNo|
|00000700| 64 65 28 29 20 3a 20 48 | 61 6e 64 6c 65 3b 0d 09 |de() : H|andle;..|
|00000710| 09 28 2a 20 54 68 69 73 | 20 70 72 6f 63 65 64 75 |.(* This| procedu|
|00000720| 72 65 20 72 65 6d 6f 76 | 65 73 20 61 20 6e 6f 64 |re remov|es a nod|
|00000730| 65 20 66 72 6f 6d 0d 09 | 09 20 20 20 74 68 65 20 |e from..|. the |
|00000740| 66 72 6f 6e 74 20 6f 66 | 20 74 68 65 20 6c 69 6e |front of| the lin|
|00000750| 6b 65 64 20 6c 69 73 74 | 2e 20 20 49 74 0d 09 09 |ked list|. It...|
|00000760| 09 20 72 65 74 75 72 6e | 73 20 74 68 65 20 72 65 |. return|s the re|
|00000770| 73 6f 75 72 63 65 20 68 | 61 6e 64 6c 65 20 66 6f |source h|andle fo|
|00000780| 75 6e 64 20 69 6e 0d 09 | 09 09 20 74 68 65 20 6e |und in..|.. the n|
|00000790| 6f 64 65 20 6f 72 20 4e | 49 4c 20 69 66 20 74 68 |ode or N|IL if th|
|000007a0| 65 72 65 20 61 72 65 20 | 6e 6f 20 6d 6f 72 65 0d |ere are |no more.|
|000007b0| 09 09 09 20 6e 6f 64 65 | 73 2e 20 2a 29 0d 09 09 |... node|s. *)...|
|000007c0| 09 56 41 52 0d 09 09 09 | 09 64 61 74 61 20 3a 20 |.VAR....|.data : |
|000007d0| 48 61 6e 64 6c 65 3b 0d | 09 09 09 09 6f 6c 64 4e |Handle;.|....oldN|
|000007e0| 6f 64 65 20 3a 20 52 73 | 72 63 50 74 72 3b 0d 09 |ode : Rs|rcPtr;..|
|000007f0| 09 42 45 47 49 4e 0d 09 | 09 09 49 46 20 72 73 72 |.BEGIN..|..IF rsr|
|00000800| 63 48 65 61 64 20 23 20 | 4e 49 4c 20 54 48 45 4e |cHead # |NIL THEN|
|00000810| 0d 09 09 09 09 64 61 74 | 61 20 3a 3d 20 72 73 72 |.....dat|a := rsr|
|00000820| 63 48 65 61 64 5e 2e 72 | 73 72 63 48 61 6e 64 6c |cHead^.r|srcHandl|
|00000830| 65 3b 0d 09 09 09 09 6f | 6c 64 4e 6f 64 65 20 3a |e;.....o|ldNode :|
|00000840| 3d 20 72 73 72 63 48 65 | 61 64 3b 0d 09 09 09 09 |= rsrcHe|ad;.....|
|00000850| 72 73 72 63 48 65 61 64 | 20 3a 3d 20 6f 6c 64 4e |rsrcHead| := oldN|
|00000860| 6f 64 65 5e 2e 6e 65 78 | 74 3b 0d 09 09 09 09 44 |ode^.nex|t;.....D|
|00000870| 49 53 50 4f 53 45 28 6f | 6c 64 4e 6f 64 65 29 3b |ISPOSE(o|ldNode);|
|00000880| 0d 09 09 09 45 4c 53 45 | 0d 09 09 09 09 64 61 74 |....ELSE|.....dat|
|00000890| 61 20 3a 3d 20 4e 49 4c | 3b 0d 09 09 09 45 4e 44 |a := NIL|;....END|
|000008a0| 3b 0d 09 09 09 52 45 54 | 55 52 4e 20 64 61 74 61 |;....RET|URN data|
|000008b0| 3b 0d 09 09 45 4e 44 20 | 52 6d 76 65 52 73 72 63 |;...END |RmveRsrc|
|000008c0| 4e 6f 64 65 3b 0d 09 09 | 0d 09 42 45 47 49 4e 0d |Node;...|..BEGIN.|
|000008d0| 09 09 72 73 72 63 48 65 | 61 64 20 3a 3d 20 4e 49 |..rsrcHe|ad := NI|
|000008e0| 4c 3b 20 28 2a 20 49 6e | 69 74 20 74 68 65 20 6c |L; (* In|it the l|
|000008f0| 69 73 74 20 68 65 61 64 | 65 72 20 2a 29 0d 09 45 |ist head|er *)..E|
|00000900| 4e 44 20 4c 69 6e 6b 65 | 64 4c 69 73 74 3b 0d 09 |ND Linke|dList;..|
|00000910| 0d 20 20 50 52 4f 43 45 | 44 55 52 45 20 4d 6f 76 |. PROCE|DURE Mov|
|00000920| 65 52 73 72 63 73 20 28 | 73 72 63 2c 20 64 65 73 |eRsrcs (|src, des|
|00000930| 74 20 3a 20 49 4e 54 45 | 47 45 52 3b 0d 20 20 20 |t : INTE|GER;. |
|00000940| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000950| 20 20 20 20 6e 6f 69 73 | 79 20 3a 20 42 4f 4f 4c | nois|y : BOOL|
|00000960| 45 41 4e 3b 0d 09 09 09 | 09 09 09 09 09 09 09 09 |EAN;....|........|
|00000970| 20 61 6c 6c 6f 77 44 75 | 70 6c 69 63 61 74 65 20 | allowDu|plicate |
|00000980| 3a 20 42 4f 4f 4c 45 41 | 4e 3b 0d 09 09 20 20 20 |: BOOLEA|N;... |
|00000990| 20 20 20 09 09 09 09 09 | 09 20 56 41 52 20 65 72 | .....|. VAR er|
|000009a0| 72 6f 72 20 3a 20 52 73 | 72 63 45 72 72 29 3b 0d |ror : Rs|rcErr);.|
|000009b0| 09 28 2a 20 4d 6f 76 65 | 73 20 61 6c 6c 20 72 65 |.(* Move|s all re|
|000009c0| 73 6f 75 72 63 65 73 20 | 66 72 6f 6d 20 74 68 65 |sources |from the|
|000009d0| 20 73 72 63 20 72 65 73 | 6f 75 72 63 65 0d 09 20 | src res|ource.. |
|000009e0| 20 20 66 69 6c 65 20 6e | 75 6d 62 65 72 20 74 6f | file n|umber to|
|000009f0| 20 74 68 65 20 64 65 73 | 74 20 72 65 73 6f 75 72 | the des|t resour|
|00000a00| 63 65 20 66 69 6c 65 20 | 6e 75 6d 62 65 72 2e 0d |ce file |number..|
|00000a10| 09 09 20 49 66 20 6e 6f | 69 73 79 20 69 73 20 74 |.. If no|isy is t|
|00000a20| 72 75 65 2c 20 74 68 65 | 6e 20 69 6e 66 6f 72 6d |rue, the|n inform|
|00000a30| 61 74 69 6f 6e 20 69 73 | 20 70 72 69 6e 74 65 64 |ation is| printed|
|00000a40| 0d 09 09 20 61 62 6f 75 | 74 20 65 61 63 68 20 72 |... abou|t each r|
|00000a50| 65 73 6f 75 72 63 65 20 | 61 73 20 69 74 20 69 73 |esource |as it is|
|00000a60| 20 63 6f 70 69 65 64 2e | 20 20 49 66 0d 09 09 20 | copied.| If... |
|00000a70| 61 6c 6c 6f 77 44 75 70 | 6c 69 63 61 74 65 20 69 |allowDup|licate i|
|00000a80| 73 20 74 72 75 65 2c 20 | 74 68 65 6e 20 61 20 64 |s true, |then a d|
|00000a90| 65 73 74 69 6e 61 74 69 | 6f 6e 0d 09 09 20 72 65 |estinati|on... re|
|00000aa0| 73 6f 75 72 63 65 20 6f | 66 20 74 68 65 20 73 61 |source o|f the sa|
|00000ab0| 6d 65 20 74 79 70 65 20 | 61 6e 64 20 49 44 20 61 |me type |and ID a|
|00000ac0| 73 20 61 20 73 6f 75 72 | 63 65 0d 09 09 20 72 65 |s a sour|ce... re|
|00000ad0| 73 6f 75 72 63 65 20 69 | 73 20 72 65 70 6c 61 63 |source i|s replac|
|00000ae0| 65 64 20 62 79 20 74 68 | 65 20 73 6f 75 72 63 65 |ed by th|e source|
|00000af0| 20 72 65 73 6f 75 72 63 | 65 2e 0d 09 09 20 49 66 | resourc|e.... If|
|00000b00| 20 61 6c 6c 6f 77 44 75 | 70 6c 69 63 61 74 65 20 | allowDu|plicate |
|00000b10| 69 73 20 66 61 6c 73 65 | 2c 20 74 68 65 6e 20 61 |is false|, then a|
|00000b20| 6e 20 65 72 72 6f 72 20 | 69 73 0d 09 09 20 72 65 |n error |is... re|
|00000b30| 74 75 72 6e 65 64 20 77 | 68 65 6e 20 61 20 64 75 |turned w|hen a du|
|00000b40| 70 6c 69 63 61 74 65 20 | 69 73 20 66 6f 75 6e 64 |plicate |is found|
|00000b50| 2e 20 2a 29 0d 0d 20 20 | 20 20 56 41 52 0d 20 20 |. *).. | VAR. |
|00000b60| 20 20 20 20 74 68 65 54 | 79 70 65 20 3a 20 52 65 | theT|ype : Re|
|00000b70| 73 54 79 70 65 3b 0d 20 | 20 20 20 20 20 72 73 72 |sType;. | rsr|
|00000b80| 63 48 64 6c 2c 20 64 65 | 73 74 48 64 6c 20 3a 20 |cHdl, de|stHdl : |
|00000b90| 48 61 6e 64 6c 65 3b 0d | 20 20 20 20 20 20 74 79 |Handle;.| ty|
|00000ba0| 70 65 73 2c 20 72 73 72 | 63 73 2c 20 74 68 65 49 |pes, rsr|cs, theI|
|00000bb0| 44 20 3a 20 49 4e 54 45 | 47 45 52 3b 0d 20 20 20 |D : INTE|GER;. |
|00000bc0| 20 20 20 72 73 72 63 4e | 61 6d 65 20 3a 20 53 74 | rsrcN|ame : St|
|00000bd0| 72 32 35 35 3b 0d 09 09 | 09 0d 09 09 50 52 4f 43 |r255;...|....PROC|
|00000be0| 45 44 55 52 45 20 43 68 | 65 63 6b 45 72 72 6f 72 |EDURE Ch|eckError|
|00000bf0| 0d 09 09 09 09 09 09 09 | 09 28 56 41 52 20 65 72 |........|.(VAR er|
|00000c00| 72 52 65 63 20 3a 20 52 | 73 72 63 45 72 72 29 20 |rRec : R|srcErr) |
|00000c10| 3a 20 42 4f 4f 4c 45 41 | 4e 3b 0d 09 09 28 2a 20 |: BOOLEA|N;...(* |
|00000c20| 54 68 69 73 20 70 72 6f | 63 65 64 75 72 65 20 63 |This pro|cedure c|
|00000c30| 68 65 63 6b 73 20 74 6f | 20 73 65 65 20 69 66 20 |hecks to| see if |
|00000c40| 74 68 65 20 6c 61 73 74 | 0d 09 09 20 20 20 72 65 |the last|... re|
|00000c50| 73 6f 75 72 63 65 20 70 | 72 6f 63 65 64 75 72 65 |source p|rocedure|
|00000c60| 20 67 65 6e 65 72 61 74 | 65 64 20 61 6e 20 65 72 | generat|ed an er|
|00000c70| 72 6f 72 2e 20 20 49 66 | 0d 09 09 09 20 73 6f 2c |ror. If|.... so,|
|00000c80| 20 74 68 65 6e 20 74 68 | 65 20 70 72 6f 63 65 64 | then th|e proced|
|00000c90| 75 72 65 20 66 69 6c 6c | 73 20 69 6e 20 74 68 65 |ure fill|s in the|
|00000ca0| 20 65 72 72 6f 72 0d 09 | 09 09 20 72 65 63 6f 72 | error..|.. recor|
|00000cb0| 64 2e 20 2a 29 0d 09 09 | 09 56 41 52 0d 09 09 09 |d. *)...|.VAR....|
|00000cc0| 09 72 65 73 45 72 72 6f | 72 20 3a 20 49 4e 54 45 |.resErro|r : INTE|
|00000cd0| 47 45 52 3b 0d 09 09 42 | 45 47 49 4e 0d 09 09 09 |GER;...B|EGIN....|
|00000ce0| 72 65 73 45 72 72 6f 72 | 20 3a 3d 20 52 65 73 45 |resError| := ResE|
|00000cf0| 72 72 6f 72 28 29 3b 20 | 28 2a 20 41 6e 20 65 72 |rror(); |(* An er|
|00000d00| 72 6f 72 3f 20 2a 29 0d | 09 09 20 20 49 46 20 72 |ror? *).|.. IF r|
|00000d10| 65 73 45 72 72 6f 72 20 | 23 20 30 20 54 48 45 4e |esError |# 0 THEN|
|00000d20| 20 20 20 20 28 2a 20 59 | 65 70 2e 2e 2e 20 20 20 | (* Y|ep... |
|00000d30| 20 2a 29 0d 09 09 09 09 | 57 49 54 48 20 65 72 72 | *).....|WITH err|
|00000d40| 52 65 63 20 44 4f 0d 09 | 09 09 09 09 65 72 72 54 |Rec DO..|....errT|
|00000d50| 79 70 65 20 3a 3d 20 6f | 74 68 65 72 52 73 72 63 |ype := o|therRsrc|
|00000d60| 45 72 72 6f 72 3b 0d 09 | 09 09 09 09 65 72 72 4e |Error;..|....errN|
|00000d70| 75 6d 20 3a 3d 20 72 65 | 73 45 72 72 6f 72 3b 0d |um := re|sError;.|
|00000d80| 09 09 09 09 45 4e 44 3b | 0d 09 09 09 09 28 2a 20 |....END;|.....(* |
|00000d90| 53 69 6e 63 65 20 77 65 | 20 67 6f 74 20 61 6e 20 |Since we| got an |
|00000da0| 65 72 72 6f 72 2c 0d 09 | 09 09 09 20 20 20 62 65 |error,..|... be|
|00000db0| 20 73 75 72 65 20 74 6f | 20 74 75 72 6e 20 72 65 | sure to| turn re|
|00000dc0| 73 6f 75 72 63 65 0d 09 | 09 09 09 09 20 6c 6f 61 |source..|.... loa|
|00000dd0| 64 69 6e 67 20 62 61 63 | 6b 20 6f 6e 20 73 6f 20 |ding bac|k on so |
|00000de0| 74 68 65 20 4d 61 63 0d | 09 09 09 09 09 20 77 69 |the Mac.|..... wi|
|00000df0| 6c 6c 20 77 6f 72 6b 20 | 61 73 20 65 78 70 65 63 |ll work |as expec|
|00000e00| 74 65 64 2e 20 2a 29 0d | 09 09 20 20 20 20 53 65 |ted. *).|.. Se|
|00000e10| 74 52 65 73 4c 6f 61 64 | 28 54 52 55 45 29 3b 0d |tResLoad|(TRUE);.|
|00000e20| 09 09 09 45 4e 44 3b 0d | 09 09 09 52 45 54 55 52 |...END;.|...RETUR|
|00000e30| 4e 20 72 65 73 45 72 72 | 6f 72 20 23 20 30 3b 0d |N resErr|or # 0;.|
|00000e40| 09 09 45 4e 44 20 43 68 | 65 63 6b 45 72 72 6f 72 |..END Ch|eckError|
|00000e50| 3b 0d 09 09 0d 20 20 42 | 45 47 49 4e 0d 09 09 65 |;.... B|EGIN...e|
|00000e60| 72 72 6f 72 2e 65 72 72 | 54 79 70 65 20 3a 3d 20 |rror.err|Type := |
|00000e70| 6e 6f 52 73 72 63 45 72 | 72 6f 72 3b 20 28 2a 20 |noRsrcEr|ror; (* |
|00000e80| 49 6e 69 74 20 6e 6f 20 | 65 72 72 6f 72 20 2a 29 |Init no |error *)|
|00000e90| 0d 09 09 0d 09 09 28 2a | 20 53 69 6e 63 65 20 77 |......(*| Since w|
|00000ea0| 65 20 61 72 65 20 6f 6e | 6c 79 20 69 6e 74 65 72 |e are on|ly inter|
|00000eb0| 65 73 74 65 64 20 69 6e | 20 66 69 67 75 72 69 6e |ested in| figurin|
|00000ec0| 67 0d 09 09 20 20 20 6f | 75 74 20 77 68 69 63 68 |g... o|ut which|
|00000ed0| 20 72 65 73 6f 75 72 63 | 65 73 20 65 78 69 73 74 | resourc|es exist|
|00000ee0| 20 69 6e 20 74 68 65 20 | 73 6f 75 72 63 65 20 66 | in the |source f|
|00000ef0| 69 6c 65 2c 0d 09 09 09 | 20 77 65 20 74 75 72 6e |ile,....| we turn|
|00000f00| 20 6f 66 66 20 72 65 73 | 6f 75 72 63 65 20 6c 6f | off res|ource lo|
|00000f10| 61 64 69 6e 67 2e 20 20 | 54 68 69 73 20 70 72 65 |ading. |This pre|
|00000f20| 76 65 6e 74 73 0d 09 09 | 09 20 74 68 65 20 68 65 |vents...|. the he|
|00000f30| 61 70 20 66 72 6f 6d 20 | 62 65 63 6f 6d 69 6e 67 |ap from |becoming|
|00000f40| 20 70 6f 6c 6c 75 74 65 | 64 20 77 69 74 68 20 62 | pollute|d with b|
|00000f50| 69 6c 6c 69 6f 6e 73 0d | 09 09 09 20 6f 66 20 72 |illions.|... of r|
|00000f60| 65 73 6f 75 72 63 65 73 | 2e 20 2a 29 0d 20 20 20 |esources|. *). |
|00000f70| 20 53 65 74 52 65 73 4c | 6f 61 64 28 46 41 4c 53 | SetResL|oad(FALS|
|00000f80| 45 29 3b 0d 09 09 49 46 | 20 43 68 65 63 6b 45 72 |E);...IF| CheckEr|
|00000f90| 72 6f 72 28 65 72 72 6f | 72 29 20 54 48 45 4e 20 |ror(erro|r) THEN |
|00000fa0| 52 45 54 55 52 4e 20 45 | 4e 44 3b 0d 0d 09 09 28 |RETURN E|ND;....(|
|00000fb0| 2a 20 43 68 65 63 6b 20 | 6f 75 74 20 61 6c 6c 20 |* Check |out all |
|00000fc0| 74 68 65 20 72 65 73 6f | 75 72 63 65 20 74 79 70 |the reso|urce typ|
|00000fd0| 65 73 20 66 6f 75 6e 64 | 20 69 6e 0d 09 09 09 20 |es found| in.... |
|00000fe0| 61 6c 6c 20 74 68 65 20 | 6f 70 65 6e 20 72 65 73 |all the |open res|
|00000ff0| 6f 75 72 63 65 20 66 69 | 6c 65 73 20 28 77 68 69 |ource fi|les (whi|
|00001000| 63 68 20 61 72 65 0d 09 | 09 09 20 70 72 6f 62 61 |ch are..|.. proba|
|00001010| 62 6c 79 3a 0d 09 09 09 | 20 09 09 31 2d 20 53 79 |bly:....| ..1- Sy|
|00001020| 73 74 65 6d 0d 09 09 09 | 09 09 32 2d 20 4d 6f 64 |stem....|..2- Mod|
|00001030| 75 6c 61 2d 32 20 69 6e | 74 65 72 70 72 65 74 65 |ula-2 in|terprete|
|00001040| 72 0d 09 09 09 09 09 33 | 2d 20 54 68 65 20 2e 4c |r......3|- The .L|
|00001050| 4f 44 20 66 69 6c 65 20 | 74 68 61 74 20 69 6d 70 |OD file |that imp|
|00001060| 6f 72 74 73 20 74 68 69 | 73 0d 09 09 09 09 09 20 |orts thi|s...... |
|00001070| 20 20 6d 6f 64 75 6c 65 | 0d 09 09 09 09 09 34 2d | module|......4-|
|00001080| 20 54 68 65 20 73 6f 75 | 72 63 65 20 72 65 73 6f | The sou|rce reso|
|00001090| 75 72 63 65 20 66 69 6c | 65 0d 09 09 09 09 09 35 |urce fil|e......5|
|000010a0| 2d 20 54 68 65 20 64 65 | 73 74 69 6e 61 74 69 6f |- The de|stinatio|
|000010b0| 6e 20 72 65 73 6f 75 72 | 63 65 20 66 69 6c 65 29 |n resour|ce file)|
|000010c0| 0d 09 09 2a 29 0d 20 20 | 20 20 46 4f 52 20 74 79 |...*). | FOR ty|
|000010d0| 70 65 73 20 3a 3d 20 31 | 20 54 4f 20 43 6f 75 6e |pes := 1| TO Coun|
|000010e0| 74 54 79 70 65 73 28 29 | 20 44 4f 0d 20 20 20 20 |tTypes()| DO. |
|000010f0| 20 20 47 65 74 49 6e 64 | 54 79 70 65 28 74 68 65 | GetInd|Type(the|
|00001100| 54 79 70 65 2c 74 79 70 | 65 73 29 3b 20 28 2a 20 |Type,typ|es); (* |
|00001110| 67 65 74 20 74 68 65 20 | 74 79 70 65 20 2a 29 0d |get the |type *).|
|00001120| 09 09 09 28 2a 20 47 6f | 20 74 68 72 6f 75 67 68 |...(* Go| through|
|00001130| 20 61 6c 6c 20 74 68 65 | 20 72 65 73 6f 75 72 63 | all the| resourc|
|00001140| 65 73 20 6f 66 20 61 20 | 67 69 76 65 6e 0d 09 09 |es of a |given...|
|00001150| 09 20 20 20 74 79 70 65 | 2e 20 2a 29 0d 20 20 20 |. type|. *). |
|00001160| 20 20 20 46 4f 52 20 72 | 73 72 63 73 20 3a 3d 20 | FOR r|srcs := |
|00001170| 31 20 54 4f 20 43 6f 75 | 6e 74 52 65 73 6f 75 72 |1 TO Cou|ntResour|
|00001180| 63 65 73 28 74 68 65 54 | 79 70 65 29 20 44 4f 0d |ces(theT|ype) DO.|
|00001190| 09 09 09 09 28 2a 20 47 | 65 74 20 61 20 68 61 6e |....(* G|et a han|
|000011a0| 64 6c 65 20 74 6f 20 74 | 68 65 20 72 65 73 6f 75 |dle to t|he resou|
|000011b0| 72 63 65 2e 20 20 4e 6f | 74 65 0d 09 09 09 09 09 |rce. No|te......|
|000011c0| 20 74 68 61 74 20 74 68 | 65 20 72 65 73 6f 75 72 | that th|e resour|
|000011d0| 63 65 20 69 73 6e 27 74 | 20 6c 6f 61 64 65 64 20 |ce isn't| loaded |
|000011e0| 62 65 63 61 75 73 65 0d | 09 09 09 09 09 20 77 65 |because.|..... we|
|000011f0| 20 74 75 72 6e 65 64 20 | 72 65 73 6f 75 72 63 65 | turned |resource|
|00001200| 20 6c 6f 61 64 69 6e 67 | 20 6f 66 66 2e 20 2a 29 | loading| off. *)|
|00001210| 0d 20 20 20 20 20 20 20 | 20 72 73 72 63 48 64 6c |. | rsrcHdl|
|00001220| 20 3a 3d 20 47 65 74 49 | 6e 64 52 65 73 6f 75 72 | := GetI|ndResour|
|00001230| 63 65 28 74 68 65 54 79 | 70 65 2c 72 73 72 63 73 |ce(theTy|pe,rsrcs|
|00001240| 29 3b 0d 09 09 09 09 49 | 46 20 43 68 65 63 6b 45 |);.....I|F CheckE|
|00001250| 72 72 6f 72 28 65 72 72 | 6f 72 29 20 54 48 45 4e |rror(err|or) THEN|
|00001260| 20 52 45 54 55 52 4e 20 | 45 4e 44 3b 0d 09 09 09 | RETURN |END;....|
|00001270| 09 28 2a 20 49 66 20 74 | 68 65 20 72 65 73 6f 75 |.(* If t|he resou|
|00001280| 72 63 65 20 62 65 6c 6f | 6e 67 73 20 74 6f 20 74 |rce belo|ngs to t|
|00001290| 68 65 0d 09 09 09 09 20 | 20 20 73 6f 75 72 63 65 |he..... | source|
|000012a0| 20 66 69 6c 65 2c 20 74 | 68 65 6e 20 77 65 20 61 | file, t|hen we a|
|000012b0| 72 65 20 69 6e 74 65 72 | 65 73 74 65 64 0d 09 09 |re inter|ested...|
|000012c0| 09 09 09 20 69 6e 20 69 | 74 2e 20 2a 29 0d 20 20 |... in i|t. *). |
|000012d0| 20 20 20 20 20 20 49 46 | 20 48 6f 6d 65 52 65 73 | IF| HomeRes|
|000012e0| 46 69 6c 65 28 72 73 72 | 63 48 64 6c 29 20 3d 20 |File(rsr|cHdl) = |
|000012f0| 73 72 63 20 54 48 45 4e | 0d 09 09 09 09 09 28 2a |src THEN|......(*|
|00001300| 20 53 61 76 65 20 74 68 | 65 20 72 65 73 6f 75 72 | Save th|e resour|
|00001310| 63 65 20 69 6e 20 74 68 | 65 20 6c 69 6e 6b 65 64 |ce in th|e linked|
|00001320| 20 6c 69 73 74 20 2a 29 | 0d 20 20 20 20 20 20 20 | list *)|. |
|00001330| 20 20 20 41 64 64 52 73 | 72 63 4e 6f 64 65 28 72 | AddRs|rcNode(r|
|00001340| 73 72 63 48 64 6c 29 3b | 0d 20 20 20 20 20 20 20 |srcHdl);|. |
|00001350| 20 45 4e 44 3b 0d 20 20 | 20 20 20 20 45 4e 44 3b | END;. | END;|
|00001360| 0d 20 20 20 20 45 4e 44 | 3b 0d 0d 09 09 28 2a 20 |. END|;....(* |
|00001370| 47 65 74 20 61 20 68 61 | 6e 64 6c 65 20 74 6f 20 |Get a ha|ndle to |
|00001380| 61 20 73 6f 75 72 63 65 | 20 72 65 73 6f 75 72 63 |a source| resourc|
|00001390| 65 0d 09 09 20 20 20 66 | 72 6f 6d 20 74 68 65 20 |e... f|rom the |
|000013a0| 6c 69 6e 6b 65 64 20 6c | 69 73 74 2e 20 2a 29 0d |linked l|ist. *).|
|000013b0| 09 09 72 73 72 63 48 64 | 6c 20 3a 3d 20 52 6d 76 |..rsrcHd|l := Rmv|
|000013c0| 65 52 73 72 63 4e 6f 64 | 65 28 29 3b 0d 09 09 28 |eRsrcNod|e();...(|
|000013d0| 2a 20 50 72 6f 63 65 73 | 73 20 75 6e 74 69 6c 20 |* Proces|s until |
|000013e0| 74 68 65 72 65 20 61 72 | 65 20 6e 6f 20 6d 6f 72 |there ar|e no mor|
|000013f0| 65 0d 09 09 20 20 20 68 | 61 6e 64 6c 65 73 20 69 |e... h|andles i|
|00001400| 6e 20 74 68 65 20 6c 69 | 73 74 2e 2e 2e 20 2a 29 |n the li|st... *)|
|00001410| 0d 20 20 20 20 57 48 49 | 4c 45 20 72 73 72 63 48 |. WHI|LE rsrcH|
|00001420| 64 6c 20 23 20 4e 49 4c | 20 44 4f 0d 09 09 09 49 |dl # NIL| DO....I|
|00001430| 46 20 6e 6f 69 73 79 20 | 54 48 45 4e 0d 09 09 09 |F noisy |THEN....|
|00001440| 09 57 72 69 74 65 53 74 | 72 69 6e 67 28 27 20 20 |.WriteSt|ring(' |
|00001450| 20 27 29 3b 0d 09 09 09 | 09 57 72 69 74 65 28 74 | ');....|.Write(t|
|00001460| 68 65 54 79 70 65 5b 30 | 5d 29 3b 20 57 72 69 74 |heType[0|]); Writ|
|00001470| 65 28 74 68 65 54 79 70 | 65 5b 31 5d 29 3b 0d 09 |e(theTyp|e[1]);..|
|00001480| 09 09 09 57 72 69 74 65 | 28 74 68 65 54 79 70 65 |...Write|(theType|
|00001490| 5b 32 5d 29 3b 20 57 72 | 69 74 65 28 74 68 65 54 |[2]); Wr|ite(theT|
|000014a0| 79 70 65 5b 33 5d 29 3b | 0d 09 09 09 09 57 72 69 |ype[3]);|.....Wri|
|000014b0| 74 65 53 74 72 69 6e 67 | 28 27 20 20 27 29 3b 0d |teString|(' ');.|
|000014c0| 09 09 09 09 57 72 69 74 | 65 49 6e 74 28 74 68 65 |....Writ|eInt(the|
|000014d0| 49 44 2c 30 29 3b 20 57 | 72 69 74 65 4c 6e 3b 0d |ID,0); W|riteLn;.|
|000014e0| 09 09 09 45 4e 44 3b 0d | 0d 09 09 09 28 2a 20 46 |...END;.|....(* F|
|000014f0| 6f 72 63 65 20 74 68 65 | 20 73 6f 75 72 63 65 20 |orce the| source |
|00001500| 72 65 73 6f 75 72 63 65 | 20 74 6f 20 62 65 20 6c |resource| to be l|
|00001510| 6f 61 64 65 64 20 2a 29 | 0d 20 20 20 20 20 20 4c |oaded *)|. L|
|00001520| 6f 61 64 52 65 73 6f 75 | 72 63 65 28 72 73 72 63 |oadResou|rce(rsrc|
|00001530| 48 64 6c 29 3b 0d 09 09 | 09 49 46 20 43 68 65 63 |Hdl);...|.IF Chec|
|00001540| 6b 45 72 72 6f 72 28 65 | 72 72 6f 72 29 20 54 48 |kError(e|rror) TH|
|00001550| 45 4e 20 52 45 54 55 52 | 4e 20 45 4e 44 3b 0d 0d |EN RETUR|N END;..|
|00001560| 09 09 09 28 2a 20 47 65 | 74 20 74 68 65 20 72 65 |...(* Ge|t the re|
|00001570| 73 6f 75 72 63 65 27 73 | 20 76 69 74 61 6c 20 73 |source's| vital s|
|00001580| 74 61 74 73 20 2a 29 0d | 20 20 20 20 20 20 47 65 |tats *).| Ge|
|00001590| 74 52 65 73 49 6e 66 6f | 28 72 73 72 63 48 64 6c |tResInfo|(rsrcHdl|
|000015a0| 2c 74 68 65 49 44 2c 74 | 68 65 54 79 70 65 2c 72 |,theID,t|heType,r|
|000015b0| 73 72 63 4e 61 6d 65 29 | 3b 0d 09 09 09 49 46 20 |srcName)|;....IF |
|000015c0| 43 68 65 63 6b 45 72 72 | 6f 72 28 65 72 72 6f 72 |CheckErr|or(error|
|000015d0| 29 20 54 48 45 4e 20 52 | 45 54 55 52 4e 20 45 4e |) THEN R|ETURN EN|
|000015e0| 44 3b 0d 0d 09 09 09 28 | 2a 20 4d 61 6b 65 20 74 |D;.....(|* Make t|
|000015f0| 68 65 20 72 65 73 6f 75 | 72 63 65 20 6d 61 6e 61 |he resou|rce mana|
|00001600| 67 65 72 20 66 6f 72 67 | 65 74 20 61 62 6f 75 74 |ger forg|et about|
|00001610| 0d 09 09 09 20 20 20 74 | 68 69 73 20 72 65 73 6f |.... t|his reso|
|00001620| 75 72 63 65 2e 20 20 2a | 29 0d 20 20 20 20 20 20 |urce. *|). |
|00001630| 44 65 74 61 63 68 52 65 | 73 6f 75 72 63 65 28 72 |DetachRe|source(r|
|00001640| 73 72 63 48 64 6c 29 3b | 0d 09 09 09 49 46 20 43 |srcHdl);|....IF C|
|00001650| 68 65 63 6b 45 72 72 6f | 72 28 65 72 72 6f 72 29 |heckErro|r(error)|
|00001660| 20 54 48 45 4e 20 52 45 | 54 55 52 4e 20 45 4e 44 | THEN RE|TURN END|
|00001670| 3b 0d 0d 09 09 09 28 2a | 20 54 65 6c 6c 20 74 68 |;.....(*| Tell th|
|00001680| 65 20 72 65 73 6f 75 72 | 63 65 20 6d 61 6e 61 67 |e resour|ce manag|
|00001690| 65 72 20 74 6f 20 73 65 | 61 72 63 68 0d 09 09 09 |er to se|arch....|
|000016a0| 09 20 74 68 65 20 64 65 | 73 74 20 72 65 73 6f 75 |. the de|st resou|
|000016b0| 72 63 65 20 66 69 6c 65 | 20 62 65 66 6f 72 65 20 |rce file| before |
|000016c0| 61 6c 6c 20 6f 74 68 65 | 72 73 20 2a 29 0d 09 09 |all othe|rs *)...|
|000016d0| 09 55 73 65 52 65 73 46 | 69 6c 65 28 64 65 73 74 |.UseResF|ile(dest|
|000016e0| 29 3b 0d 09 09 09 49 46 | 20 43 68 65 63 6b 45 72 |);....IF| CheckEr|
|000016f0| 72 6f 72 28 65 72 72 6f | 72 29 20 54 48 45 4e 20 |ror(erro|r) THEN |
|00001700| 52 45 54 55 52 4e 20 45 | 4e 44 3b 0d 0d 09 09 09 |RETURN E|ND;.....|
|00001710| 28 2a 20 57 65 27 76 65 | 20 61 6c 72 65 61 64 79 |(* We've| already|
|00001720| 20 70 75 6c 6c 65 64 20 | 61 20 72 65 73 6f 75 72 | pulled |a resour|
|00001730| 63 65 20 66 72 6f 6d 20 | 74 68 65 0d 09 09 09 20 |ce from |the.... |
|00001740| 20 20 73 6f 75 72 63 65 | 20 72 65 73 6f 75 72 63 | source| resourc|
|00001750| 65 20 66 69 6c 65 2e 20 | 20 54 72 79 20 74 6f 20 |e file. | Try to |
|00001760| 67 72 61 62 20 74 68 65 | 20 73 61 6d 65 0d 09 09 |grab the| same...|
|00001770| 09 09 20 6f 6e 65 20 66 | 72 6f 6d 20 74 68 65 20 |.. one f|rom the |
|00001780| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 66 69 6c 65 |destinat|ion file|
|00001790| 2e 20 20 49 66 20 74 68 | 65 20 67 72 61 62 0d 09 |. If th|e grab..|
|000017a0| 09 09 09 20 69 73 20 73 | 75 63 63 65 73 73 66 75 |... is s|uccessfu|
|000017b0| 6c 2c 20 74 68 65 6e 20 | 77 65 20 68 61 76 65 20 |l, then |we have |
|000017c0| 61 20 64 75 70 6c 69 63 | 61 74 65 2e 20 2a 29 0d |a duplic|ate. *).|
|000017d0| 09 09 09 64 65 73 74 48 | 64 6c 20 3a 3d 20 47 65 |...destH|dl := Ge|
|000017e0| 74 52 65 73 6f 75 72 63 | 65 28 74 68 65 54 79 70 |tResourc|e(theTyp|
|000017f0| 65 2c 74 68 65 49 44 29 | 3b 0d 09 09 09 49 46 20 |e,theID)|;....IF |
|00001800| 28 52 65 73 45 72 72 6f | 72 28 29 20 3d 20 4e 6f |(ResErro|r() = No|
|00001810| 45 72 72 29 20 41 4e 44 | 20 28 48 6f 6d 65 52 65 |Err) AND| (HomeRe|
|00001820| 73 46 69 6c 65 28 64 65 | 73 74 48 64 6c 29 20 3d |sFile(de|stHdl) =|
|00001830| 20 64 65 73 74 29 20 54 | 48 45 4e 0d 09 09 09 09 | dest) T|HEN.....|
|00001840| 49 46 20 4e 4f 54 20 61 | 6c 6c 6f 77 44 75 70 6c |IF NOT a|llowDupl|
|00001850| 69 63 61 74 65 20 54 48 | 45 4e 0d 09 09 09 09 09 |icate TH|EN......|
|00001860| 28 2a 20 54 68 65 20 75 | 73 65 72 20 72 65 71 75 |(* The u|ser requ|
|00001870| 65 73 74 65 64 20 6e 6f | 20 64 75 70 6c 69 63 61 |ested no| duplica|
|00001880| 74 65 73 0d 09 09 09 09 | 09 20 20 20 73 6f 20 73 |tes.....|. so s|
|00001890| 65 74 20 74 68 65 20 65 | 72 72 6f 72 20 61 6e 64 |et the e|rror and|
|000018a0| 20 65 78 69 74 2e 20 2a | 29 0d 09 09 09 09 09 57 | exit. *|)......W|
|000018b0| 49 54 48 20 65 72 72 6f | 72 20 44 4f 0d 09 09 09 |ITH erro|r DO....|
|000018c0| 09 09 09 65 72 72 54 79 | 70 65 20 3a 3d 20 64 75 |...errTy|pe := du|
|000018d0| 70 6c 69 63 61 74 65 52 | 73 72 63 3b 0d 09 09 09 |plicateR|src;....|
|000018e0| 09 09 09 57 49 54 48 20 | 64 75 70 49 6e 66 6f 20 |...WITH |dupInfo |
|000018f0| 44 4f 0d 09 09 09 09 09 | 09 09 64 75 70 49 44 20 |DO......|..dupID |
|00001900| 3a 3d 20 74 68 65 49 44 | 3b 0d 09 09 09 09 09 09 |:= theID|;.......|
|00001910| 09 64 75 70 54 79 70 65 | 20 3a 3d 20 74 68 65 54 |.dupType| := theT|
|00001920| 79 70 65 3b 0d 09 09 09 | 09 09 09 45 4e 44 3b 0d |ype;....|...END;.|
|00001930| 09 09 09 09 09 45 4e 44 | 3b 0d 09 09 09 09 09 28 |.....END|;......(|
|00001940| 2a 20 42 65 66 6f 72 65 | 20 67 65 74 74 69 6e 67 |* Before| getting|
|00001950| 20 6f 75 74 20 6f 66 20 | 68 65 72 65 2c 20 74 75 | out of |here, tu|
|00001960| 72 6e 0d 09 09 09 09 09 | 20 20 20 72 65 73 6f 75 |rn......| resou|
|00001970| 72 63 65 20 6c 6f 61 64 | 69 6e 67 20 62 61 63 6b |rce load|ing back|
|00001980| 20 6f 6e 20 73 6f 20 74 | 68 65 0d 09 09 09 09 09 | on so t|he......|
|00001990| 09 20 4d 61 63 20 77 69 | 6c 6c 20 77 6f 72 6b 20 |. Mac wi|ll work |
|000019a0| 70 72 6f 70 65 72 6c 79 | 2e 20 2a 29 0d 09 09 09 |properly|. *)....|
|000019b0| 20 20 20 20 53 65 74 52 | 65 73 4c 6f 61 64 28 54 | SetR|esLoad(T|
|000019c0| 52 55 45 29 3b 0d 09 09 | 09 09 09 52 45 54 55 52 |RUE);...|...RETUR|
|000019d0| 4e 3b 0d 09 09 09 09 45 | 4c 53 45 0d 09 09 09 09 |N;.....E|LSE.....|
|000019e0| 09 28 2a 20 49 66 20 77 | 65 20 67 6f 74 20 61 20 |.(* If w|e got a |
|000019f0| 64 75 70 6c 69 63 61 74 | 65 20 61 6e 64 20 69 74 |duplicat|e and it|
|00001a00| 73 20 6f 6b 0d 09 09 09 | 09 09 09 20 77 69 74 68 |s ok....|... with|
|00001a10| 20 74 68 65 20 75 73 65 | 72 2c 20 7a 61 70 20 74 | the use|r, zap t|
|00001a20| 68 65 20 72 65 73 6f 75 | 72 63 65 0d 09 09 09 09 |he resou|rce.....|
|00001a30| 09 09 20 66 72 6f 6d 20 | 74 68 65 20 64 65 73 74 |.. from |the dest|
|00001a40| 69 6e 61 74 69 6f 6e 20 | 72 65 73 6f 75 72 63 65 |ination |resource|
|00001a50| 20 66 69 6c 65 0d 09 09 | 09 09 09 09 20 73 6f 20 | file...|.... so |
|00001a60| 69 74 20 63 61 6e 20 62 | 65 20 72 65 70 6c 61 63 |it can b|e replac|
|00001a70| 65 64 20 77 69 74 68 20 | 74 68 65 20 72 65 73 6f |ed with |the reso|
|00001a80| 75 72 63 65 0d 09 09 09 | 09 09 09 20 66 72 6f 6d |urce....|... from|
|00001a90| 20 74 68 65 20 73 6f 75 | 72 63 65 20 66 69 6c 65 | the sou|rce file|
|00001aa0| 2e 20 2a 29 0d 09 09 09 | 09 09 52 6d 76 65 52 65 |. *)....|..RmveRe|
|00001ab0| 73 6f 75 72 63 65 28 64 | 65 73 74 48 64 6c 29 3b |source(d|estHdl);|
|00001ac0| 0d 09 09 09 09 09 49 46 | 20 43 68 65 63 6b 45 72 |......IF| CheckEr|
|00001ad0| 72 6f 72 28 65 72 72 6f | 72 29 20 54 48 45 4e 20 |ror(erro|r) THEN |
|00001ae0| 52 45 54 55 52 4e 20 45 | 4e 44 3b 0d 09 09 09 09 |RETURN E|ND;.....|
|00001af0| 45 4e 44 3b 0d 09 09 09 | 45 4e 44 3b 0d 0d 09 09 |END;....|END;....|
|00001b00| 09 28 2a 20 46 69 6e 61 | 6c 6c 79 2c 20 61 64 64 |.(* Fina|lly, add|
|00001b10| 20 74 68 65 20 72 65 73 | 6f 75 72 63 65 20 66 72 | the res|ource fr|
|00001b20| 6f 6d 20 74 68 65 20 73 | 6f 75 72 63 65 0d 09 09 |om the s|ource...|
|00001b30| 09 20 20 20 66 69 6c 65 | 20 74 6f 20 74 68 65 20 |. file| to the |
|00001b40| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 66 69 6c 65 |destinat|ion file|
|00001b50| 2e 20 20 54 68 65 20 66 | 69 6c 65 73 0d 09 09 09 |. The f|iles....|
|00001b60| 09 20 77 69 6c 6c 20 62 | 65 20 75 70 64 61 74 65 |. will b|e update|
|00001b70| 64 20 77 68 65 6e 20 74 | 68 65 79 20 61 72 65 20 |d when t|hey are |
|00001b80| 63 6c 6f 73 65 64 2e 20 | 2a 29 0d 20 20 20 20 20 |closed. |*). |
|00001b90| 20 41 64 64 52 65 73 6f | 75 72 63 65 28 72 73 72 | AddReso|urce(rsr|
|00001ba0| 63 48 64 6c 2c 74 68 65 | 54 79 70 65 2c 74 68 65 |cHdl,the|Type,the|
|00001bb0| 49 44 2c 72 73 72 63 4e | 61 6d 65 29 3b 0d 09 09 |ID,rsrcN|ame);...|
|00001bc0| 09 49 46 20 43 68 65 63 | 6b 45 72 72 6f 72 28 65 |.IF Chec|kError(e|
|00001bd0| 72 72 6f 72 29 20 54 48 | 45 4e 20 52 45 54 55 52 |rror) TH|EN RETUR|
|00001be0| 4e 20 45 4e 44 3b 0d 0d | 09 09 09 28 2a 20 53 65 |N END;..|...(* Se|
|00001bf0| 74 20 74 68 69 6e 67 73 | 20 62 61 63 6b 20 73 6f |t things| back so|
|00001c00| 20 74 68 65 20 72 65 73 | 6f 75 72 63 65 20 6d 61 | the res|ource ma|
|00001c10| 6e 61 67 65 72 0d 09 09 | 09 20 20 20 77 69 6c 6c |nager...|. will|
|00001c20| 20 6c 6f 6f 6b 20 61 74 | 20 74 68 65 20 73 6f 75 | look at| the sou|
|00001c30| 72 63 65 20 72 65 73 6f | 75 72 63 65 20 66 69 6c |rce reso|urce fil|
|00001c40| 65 0d 09 09 09 09 20 66 | 69 72 73 74 2e 20 2a 29 |e..... f|irst. *)|
|00001c50| 0d 20 20 20 20 20 20 55 | 73 65 52 65 73 46 69 6c |. U|seResFil|
|00001c60| 65 28 73 72 63 29 3b 0d | 09 09 09 49 46 20 43 68 |e(src);.|...IF Ch|
|00001c70| 65 63 6b 45 72 72 6f 72 | 28 65 72 72 6f 72 29 20 |eckError|(error) |
|00001c80| 54 48 45 4e 20 52 45 54 | 55 52 4e 20 45 4e 44 3b |THEN RET|URN END;|
|00001c90| 0d 09 09 09 0d 09 09 09 | 28 2a 20 47 65 74 20 61 |........|(* Get a|
|00001ca0| 6e 6f 74 68 65 72 20 72 | 65 73 6f 75 72 63 65 20 |nother r|esource |
|00001cb0| 68 61 6e 64 6c 65 20 66 | 72 6f 6d 20 74 68 65 0d |handle f|rom the.|
|00001cc0| 09 09 09 20 20 20 6c 69 | 6e 6b 65 64 20 6c 69 73 |... li|nked lis|
|00001cd0| 74 20 61 6e 64 20 70 72 | 6f 63 65 73 73 20 69 74 |t and pr|ocess it|
|00001ce0| 2e 20 2a 29 0d 09 09 09 | 72 73 72 63 48 64 6c 20 |. *)....|rsrcHdl |
|00001cf0| 3a 3d 20 52 6d 76 65 52 | 73 72 63 4e 6f 64 65 28 |:= RmveR|srcNode(|
|00001d00| 29 3b 0d 20 20 20 20 45 | 4e 44 3b 0d 0d 20 20 20 |);. E|ND;.. |
|00001d10| 20 55 73 65 52 65 73 46 | 69 6c 65 28 64 65 73 74 | UseResF|ile(dest|
|00001d20| 29 3b 0d 09 09 49 46 20 | 43 68 65 63 6b 45 72 72 |);...IF |CheckErr|
|00001d30| 6f 72 28 65 72 72 6f 72 | 29 20 54 48 45 4e 20 52 |or(error|) THEN R|
|00001d40| 45 54 55 52 4e 20 45 4e | 44 3b 0d 0d 09 09 28 2a |ETURN EN|D;....(*|
|00001d50| 20 54 75 72 6e 20 72 65 | 73 6f 75 72 63 65 20 6c | Turn re|source l|
|00001d60| 6f 61 64 69 6e 67 20 62 | 61 63 6b 20 6f 6e 20 73 |oading b|ack on s|
|00001d70| 6f 0d 09 09 20 20 20 74 | 68 65 20 4d 61 63 20 77 |o... t|he Mac w|
|00001d80| 6f 6e 27 74 20 67 65 74 | 20 6d 61 64 2e 20 2a 29 |on't get| mad. *)|
|00001d90| 0d 20 20 20 20 53 65 74 | 52 65 73 4c 6f 61 64 28 |. Set|ResLoad(|
|00001da0| 54 52 55 45 29 3b 0d 09 | 09 49 46 20 43 68 65 63 |TRUE);..|.IF Chec|
|00001db0| 6b 45 72 72 6f 72 28 65 | 72 72 6f 72 29 20 54 48 |kError(e|rror) TH|
|00001dc0| 45 4e 20 52 45 54 55 52 | 4e 20 45 4e 44 3b 0d 20 |EN RETUR|N END;. |
|00001dd0| 20 45 4e 44 20 4d 6f 76 | 65 52 73 72 63 73 3b 0d | END Mov|eRsrcs;.|
|00001de0| 0d 09 50 52 4f 43 45 44 | 55 52 45 20 43 6c 65 61 |..PROCED|URE Clea|
|00001df0| 72 52 73 72 63 46 69 6c | 65 0d 09 20 20 20 20 20 |rRsrcFil|e.. |
|00001e00| 20 20 20 20 20 20 20 20 | 20 20 28 66 69 6c 65 3a | | (file:|
|00001e10| 41 52 52 41 59 20 4f 46 | 20 43 48 41 52 29 20 3a |ARRAY OF| CHAR) :|
|00001e20| 20 49 4e 54 45 47 45 52 | 3b 0d 09 28 2a 20 43 6c | INTEGER|;..(* Cl|
|00001e30| 65 61 72 73 20 61 6c 6c | 20 72 65 73 6f 75 72 63 |ears all| resourc|
|00001e40| 65 73 20 69 6e 20 74 68 | 65 20 72 65 73 6f 75 72 |es in th|e resour|
|00001e50| 63 65 20 66 69 6c 65 0d | 09 09 20 73 70 65 63 69 |ce file.|.. speci|
|00001e60| 66 69 65 64 20 62 79 20 | 27 66 69 6c 65 27 2e 20 |fied by |'file'. |
|00001e70| 20 43 6c 65 61 72 52 73 | 72 63 46 69 6c 65 20 72 | ClearRs|rcFile r|
|00001e80| 65 74 75 72 6e 73 0d 09 | 09 20 30 20 69 66 20 6e |eturns..|. 0 if n|
|00001e90| 6f 20 65 72 72 6f 72 20 | 6f 63 63 75 72 65 64 20 |o error |occured |
|00001ea0| 6f 72 20 74 68 65 20 65 | 72 72 6f 72 20 6e 75 6d |or the e|rror num|
|00001eb0| 62 65 72 2e 20 2a 29 0d | 09 09 43 4f 4e 53 54 0d |ber. *).|..CONST.|
|00001ec0| 09 09 20 20 42 75 66 53 | 69 7a 65 20 3d 20 31 34 |.. BufS|ize = 14|
|00001ed0| 33 3b 20 28 2a 20 4e 75 | 6d 62 65 72 20 6f 66 20 |3; (* Nu|mber of |
|00001ee0| 77 6f 72 64 73 20 74 68 | 61 74 20 61 72 65 0d 09 |words th|at are..|
|00001ef0| 09 09 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00001f00| 20 20 20 20 74 6f 20 62 | 65 20 77 72 69 74 74 65 | to b|e writte|
|00001f10| 6e 20 74 6f 20 74 68 65 | 20 72 65 73 6f 75 72 63 |n to the| resourc|
|00001f20| 65 0d 09 09 09 09 09 09 | 09 09 09 09 09 09 66 69 |e.......|......fi|
|00001f30| 6c 65 2e 20 2a 29 0d 09 | 20 20 56 41 52 0d 09 09 |le. *)..| VAR...|
|00001f40| 20 20 65 72 72 2c 20 76 | 52 65 66 4e 75 6d 2c 20 | err, v|RefNum, |
|00001f50| 72 65 66 4e 75 6d 20 3a | 20 49 4e 54 45 47 45 52 |refNum :| INTEGER|
|00001f60| 3b 0d 09 09 09 66 69 6c | 65 6e 61 6d 65 20 3a 20 |;....fil|ename : |
|00001f70| 53 74 72 32 35 35 3b 0d | 09 09 09 72 73 72 63 42 |Str255;.|...rsrcB|
|00001f80| 75 66 66 65 72 20 3a 20 | 41 52 52 41 59 20 5b 31 |uffer : |ARRAY [1|
|00001f90| 2e 2e 31 34 33 5d 20 4f | 46 20 49 4e 54 45 47 45 |..143] O|F INTEGE|
|00001fa0| 52 3b 0d 09 09 09 69 20 | 3a 20 43 41 52 44 49 4e |R;....i |: CARDIN|
|00001fb0| 41 4c 3b 0d 09 09 09 63 | 6f 75 6e 74 20 3a 20 4c |AL;....c|ount : L|
|00001fc0| 6f 6e 67 43 61 72 64 3b | 0d 09 42 45 47 49 4e 0d |ongCard;|..BEGIN.|
|00001fd0| 09 09 28 2a 20 57 65 20 | 65 78 70 65 63 74 20 74 |..(* We |expect t|
|00001fe0| 68 61 74 20 74 68 65 20 | 66 69 6c 65 20 74 68 61 |hat the |file tha|
|00001ff0| 74 0d 09 09 20 20 20 77 | 65 20 61 72 65 20 61 74 |t... w|e are at|
|00002000| 74 65 6d 70 74 69 6e 67 | 20 74 6f 20 63 6c 65 61 |tempting| to clea|
|00002010| 72 20 69 73 0d 09 09 09 | 20 66 6f 75 6e 64 20 6f |r is....| found o|
|00002020| 6e 20 74 68 65 20 64 65 | 66 61 75 6c 74 20 76 6f |n the de|fault vo|
|00002030| 6c 75 6d 65 2e 20 2a 29 | 0d 09 09 53 74 72 4d 6f |lume. *)|...StrMo|
|00002040| 64 54 6f 4d 61 63 28 66 | 69 6c 65 6e 61 6d 65 2c |dToMac(f|ilename,|
|00002050| 66 69 6c 65 29 3b 0d 09 | 09 65 72 72 20 3a 3d 20 |file);..|.err := |
|00002060| 47 65 74 56 6f 6c 28 4e | 49 4c 2c 76 52 65 66 4e |GetVol(N|IL,vRefN|
|00002070| 75 6d 29 3b 0d 09 09 49 | 46 20 65 72 72 20 23 20 |um);...I|F err # |
|00002080| 4e 6f 45 72 72 20 54 48 | 45 4e 20 52 45 54 55 52 |NoErr TH|EN RETUR|
|00002090| 4e 20 65 72 72 20 45 4e | 44 3b 0d 09 09 0d 09 09 |N err EN|D;......|
|000020a0| 28 2a 20 4f 70 65 6e 20 | 74 68 65 20 72 65 73 6f |(* Open |the reso|
|000020b0| 75 72 63 65 20 66 6f 72 | 6b 2e 20 2a 29 0d 09 20 |urce for|k. *).. |
|000020c0| 20 65 72 72 20 3a 3d 20 | 46 53 4f 70 65 6e 52 46 | err := |FSOpenRF|
|000020d0| 28 66 69 6c 65 6e 61 6d | 65 2c 76 52 65 66 4e 75 |(filenam|e,vRefNu|
|000020e0| 6d 2c 72 65 66 4e 75 6d | 29 3b 0d 09 09 49 46 20 |m,refNum|);...IF |
|000020f0| 65 72 72 20 3d 20 46 69 | 6c 65 4e 6f 74 46 6f 75 |err = Fi|leNotFou|
|00002100| 6e 64 45 72 72 20 54 48 | 45 4e 0d 09 09 09 28 2a |ndErr TH|EN....(*|
|00002110| 20 49 66 20 74 68 65 72 | 65 20 77 61 73 20 6e 6f | If ther|e was no|
|00002120| 20 72 65 73 6f 75 72 63 | 65 20 66 69 6c 65 2c 0d | resourc|e file,.|
|00002130| 09 09 09 09 20 74 68 65 | 6e 20 63 72 65 61 74 65 |.... the|n create|
|00002140| 20 6f 6e 65 2e 20 2a 29 | 0d 09 09 20 20 43 72 65 | one. *)|... Cre|
|00002150| 61 74 65 52 65 73 46 69 | 6c 65 28 66 69 6c 65 6e |ateResFi|le(filen|
|00002160| 61 6d 65 29 3b 0d 09 09 | 09 65 72 72 20 3a 3d 20 |ame);...|.err := |
|00002170| 52 65 73 45 72 72 6f 72 | 28 29 3b 0d 09 09 45 4c |ResError|();...EL|
|00002180| 53 45 0d 09 09 09 49 46 | 20 65 72 72 20 23 20 4e |SE....IF| err # N|
|00002190| 6f 45 72 72 20 54 48 45 | 4e 20 52 45 54 55 52 4e |oErr THE|N RETURN|
|000021a0| 20 65 72 72 20 45 4e 44 | 3b 0d 09 09 09 28 2a 20 | err END|;....(* |
|000021b0| 54 68 65 20 72 65 73 6f | 75 72 63 65 20 66 69 6c |The reso|urce fil|
|000021c0| 65 20 61 6c 72 65 61 64 | 79 20 65 78 69 73 74 73 |e alread|y exists|
|000021d0| 2e 0d 09 09 09 20 20 20 | 57 72 69 74 65 20 6f 76 |..... |Write ov|
|000021e0| 65 72 20 74 68 65 20 69 | 6e 66 6f 20 74 68 61 74 |er the i|nfo that|
|000021f0| 27 73 20 74 68 65 72 65 | 0d 09 09 09 09 20 77 69 |'s there|..... wi|
|00002200| 74 68 20 61 20 72 65 73 | 6f 75 72 63 65 20 6d 61 |th a res|ource ma|
|00002210| 70 20 74 68 61 74 20 6d | 61 6b 65 73 20 74 68 65 |p that m|akes the|
|00002220| 0d 09 09 09 09 20 72 65 | 73 6f 75 72 63 65 20 66 |..... re|source f|
|00002230| 69 6c 65 20 6c 6f 6f 6b | 20 65 6d 70 74 79 2e 20 |ile look| empty. |
|00002240| 2a 29 0d 09 09 09 46 4f | 52 20 69 20 3a 3d 20 31 |*)....FO|R i := 1|
|00002250| 20 54 4f 20 42 75 66 53 | 69 7a 65 20 44 4f 0d 09 | TO BufS|ize DO..|
|00002260| 09 09 20 20 72 73 72 63 | 42 75 66 66 65 72 5b 69 |.. rsrc|Buffer[i|
|00002270| 5d 20 3a 3d 20 30 3b 0d | 09 09 09 45 4e 44 3b 0d |] := 0;.|...END;.|
|00002280| 09 09 09 72 73 72 63 42 | 75 66 66 65 72 5b 32 5d |...rsrcB|uffer[2]|
|00002290| 20 20 20 3a 3d 20 30 30 | 31 30 30 68 3b 0d 09 09 | := 00|100h;...|
|000022a0| 09 72 73 72 63 42 75 66 | 66 65 72 5b 34 5d 20 20 |.rsrcBuf|fer[4] |
|000022b0| 20 3a 3d 20 30 30 31 30 | 30 68 3b 0d 09 09 09 72 | := 0010|0h;....r|
|000022c0| 73 72 63 42 75 66 66 65 | 72 5b 38 5d 20 20 20 3a |srcBuffe|r[8] :|
|000022d0| 3d 20 30 30 30 31 65 68 | 3b 0d 09 09 09 72 73 72 |= 0001eh|;....rsr|
|000022e0| 63 42 75 66 66 65 72 5b | 31 33 30 5d 20 3a 3d 20 |cBuffer[|130] := |
|000022f0| 30 30 31 30 30 68 3b 0d | 09 09 09 72 73 72 63 42 |00100h;.|...rsrcB|
|00002300| 75 66 66 65 72 5b 31 33 | 33 5d 20 3a 3d 20 30 30 |uffer[13|3] := 00|
|00002310| 31 30 30 68 3b 0d 09 09 | 09 72 73 72 63 42 75 66 |100h;...|.rsrcBuf|
|00002320| 66 65 72 5b 31 33 36 5d | 20 3a 3d 20 30 30 30 31 |fer[136]| := 0001|
|00002330| 65 68 3b 0d 09 09 09 72 | 73 72 63 42 75 66 66 65 |eh;....r|srcBuffe|
|00002340| 72 5b 31 34 31 5d 20 3a | 3d 20 30 30 30 31 63 68 |r[141] :|= 0001ch|
|00002350| 3b 0d 09 09 09 72 73 72 | 63 42 75 66 66 65 72 5b |;....rsr|cBuffer[|
|00002360| 31 34 32 5d 20 3a 3d 20 | 30 30 30 31 65 68 3b 0d |142] := |0001eh;.|
|00002370| 09 09 09 72 73 72 63 42 | 75 66 66 65 72 5b 31 34 |...rsrcB|uffer[14|
|00002380| 33 5d 20 3a 3d 20 2d 31 | 3b 0d 09 09 09 63 6f 75 |3] := -1|;....cou|
|00002390| 6e 74 2e 68 20 3a 3d 20 | 30 3b 0d 09 09 09 63 6f |nt.h := |0;....co|
|000023a0| 75 6e 74 2e 6c 20 3a 3d | 20 42 75 66 53 69 7a 65 |unt.l :=| BufSize|
|000023b0| 2a 32 3b 0d 09 09 09 65 | 72 72 20 3a 3d 20 46 53 |*2;....e|rr := FS|
|000023c0| 57 72 69 74 65 28 72 65 | 66 4e 75 6d 2c 63 6f 75 |Write(re|fNum,cou|
|000023d0| 6e 74 2c 41 44 52 28 72 | 73 72 63 42 75 66 66 65 |nt,ADR(r|srcBuffe|
|000023e0| 72 29 29 3b 0d 09 09 09 | 0d 09 09 09 28 2a 20 54 |r));....|....(* T|
|000023f0| 72 75 6e 63 61 74 65 20 | 74 68 65 20 72 65 73 6f |runcate |the reso|
|00002400| 75 72 63 65 20 66 69 6c | 65 20 74 6f 20 74 68 65 |urce fil|e to the|
|00002410| 20 73 69 7a 65 0d 09 09 | 09 20 20 20 6f 66 20 61 | size...|. of a|
|00002420| 6e 20 65 6d 70 74 79 20 | 72 65 73 6f 75 72 63 65 |n empty |resource|
|00002430| 20 66 69 6c 65 2e 20 2a | 29 0d 09 09 09 76 52 65 | file. *|)....vRe|
|00002440| 66 4e 75 6d 20 3a 3d 20 | 53 65 74 45 4f 46 28 72 |fNum := |SetEOF(r|
|00002450| 65 66 4e 75 6d 2c 63 6f | 75 6e 74 29 3b 0d 09 09 |efNum,co|unt);...|
|00002460| 09 76 52 65 66 4e 75 6d | 20 3a 3d 20 46 53 43 6c |.vRefNum| := FSCl|
|00002470| 6f 73 65 28 72 65 66 4e | 75 6d 29 3b 0d 09 09 45 |ose(refN|um);...E|
|00002480| 4e 44 3b 0d 09 09 52 45 | 54 55 52 4e 20 65 72 72 |ND;...RE|TURN err|
|00002490| 3b 0d 09 45 4e 44 20 43 | 6c 65 61 72 52 73 72 63 |;..END C|learRsrc|
|000024a0| 46 69 6c 65 3b 0d 09 0d | 45 4e 44 20 4d 6f 76 65 |File;...|END Move|
|000024b0| 52 65 73 6f 75 72 63 65 | 73 2e 0d 00 00 00 00 00 |Resource|s.......|
|000024c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002500| 00 00 01 00 00 00 01 16 | 00 00 00 16 00 00 00 d4 |........|........|
|00002510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002530| 11 4d 6f 76 65 52 65 73 | 6f 75 72 63 65 73 2e 4d |.MoveRes|ources.M|
|00002540| 4f 44 02 00 00 00 54 45 | 58 54 45 44 49 54 01 00 |OD....TE|XTEDIT..|
|00002550| 00 00 54 45 58 54 45 44 | 49 54 01 00 ff fd 00 9c |..TEXTED|IT......|
|00002560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002570| 00 00 99 bb 73 6e 00 00 | 24 3b 00 00 01 ea 00 00 |....sn..|$;......|
|00002580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002600| 00 00 00 0a 00 09 06 4d | 6f 6e 61 63 6f 28 00 00 |.......M|onaco(..|
|00002610| 00 04 00 06 00 02 00 00 | 01 00 00 00 01 16 00 00 |........|........|
|00002620| 00 16 00 00 00 d4 00 00 | cc 1c 00 b6 00 00 00 1c |........|........|
|00002630| 00 46 00 01 45 46 4e 54 | 00 00 00 12 45 54 41 42 |.F..EFNT|....ETAB|
|00002640| 00 00 00 1e 03 eb 00 00 | 00 00 00 00 00 01 6e f2 |........|......n.|
|00002650| 03 ec 00 47 00 00 00 0e | 00 01 6e ce 46 4f 42 4a |...G....|..n.FOBJ|
|00002660| ff ff ff ff 00 07 69 f6 | 00 07 6a 1e 00 07 6a 48 |......i.|..j...jH|
|00002670| 00 07 6a 68 00 07 6a 7a | 00 07 6a 8c 00 40 01 b6 |..jh..jz|..j..@..|
|00002680| 00 07 67 d6 00 07 75 e8 | 00 07 6a 9e 00 40 01 be |..g...u.|..j..@..|
|00002690| 00 40 01 be 00 40 01 be | 00 40 01 be 00 40 01 be |.@...@..|.@...@..|
|000026a0| 00 40 01 46 4f 42 4a ff | ff ff ff 00 07 69 f6 00 |.@.FOBJ.|.....i..|
|000026b0| 07 6a 1e 00 07 6a 48 00 | 07 6a 68 00 07 6a 7a 00 |.j...jH.|.jh..jz.|
|000026c0| 07 6a 8c 00 40 01 b6 00 | 07 67 d6 00 07 75 e8 00 |.j..@...|.g...u..|
|000026d0| 07 6a 9e 00 40 01 be 00 | 40 01 be 00 40 01 be 00 |.j..@...|@...@...|
|000026e0| 40 01 be 00 40 01 be 00 | 40 01 00 00 00 00 00 00 |@...@...|@.......|
|000026f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+